Specialization inheritance and specialization bounded polymorphism

نویسنده

  • Marco Temperini
چکیده

We define a specialization inheritance mechanism for object-oriented programming, admitting covariant redefinition of both methods and instance variables in subclassing. We investigate on the semantic weakness that makes such very flexible inheritance infeasible for a statically type-checked programming language supporting polymorphic assignment and polymorphic method invocation. We show that the source of troubles is not in the covariant redefinition of methods, and present a suitable multiple dispatch mechanism. This multiple dispatch uses static type information in order to drive the execution of method invocations. Moreover it exploits the notion of method linearization (that we define in the paper) at both compile-time and run-time. The covariant redefinition of instance variables can be the source of runtime type errors in polymorphic instructions, when the update problem occurs. We devise a general mechanism to recover from the update problem. In order to be allowed to redefine covariantly class instance variables and use them in programs with polymorphism, the programmer is requested to define suitable default-value methods, able to produce a value for an instance variable starting from an actual value of the same instance variable in a superclass.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Perfect Specialization Model for Gravity Equation in Bilateral Trade based on Production Structure

Although initially originated as a totally empirical relationship to explain the volume of trade between two partners, gravity equation has been the focus of several theoretic models that try to explain it. Specialization models are of great importance in providing a solid theoretic ground for gravity equation in bilateral trade. Some research papers try to improve specialization models by addi...

متن کامل

Towards Unifying Inheritance and Automatic Program Specialization

Inheritance allows a class to be specialized and its attributes refined, but implementation specialization can only take place by overriding with manually implemented methods. Automatic program specialization can generate a specialized, efficient implementation. However, specialization of programs and specialization of classes (inheritance) are considered different abstractions. We present a ne...

متن کامل

Craft Specialization at Shahdad: Pottery Production during the third millennium BC

Many potteries have been discovered from excavations and a surface survey at Shahdad, but few works have beendone to examine craft specialization in pottery production at this important site. Different types of potteries, some ofwhich bearing potter marks demonstrate that craftsmen of the site had involved in manufacturing of centralized potteryproduction. A number of kilns and many waste of po...

متن کامل

Identifying the components of universities smart specialization strategy

The strategy for smart specialization university has been one of the main policies of the European Union in recent years to develop regional performance and economic growth through university systems. In spite of this, no research has been done to identify the components of this strategy. Accordingly, this study aimed to identify the components of the smart specialization strategy of higher edu...

متن کامل

G Eneralization / Specialization and R Ole In

The "IS A"-relationship and the mechanism of inheritance are powerful concepts that help to reduce complexity of models and redundancy in specifications. However, in the area of conceptual modeling, it seems that current Object Oriented Analysis methods put most emphasis on the structural aspects of the "IS A"-relationship while inheritance and sharing of behaviour are often not or ill-defined....

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996